﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NextCore;
using NextUI;
using NextDraw;
using OpenTK;
namespace NextOS
{
    class Program
    {
        public class Background : NextState
        {
            public Tex2D tex1;
            public static Vector3 GRot = new Vector3(0, 0, 0);
            public Background() : base("BackgroundThread",true)
            {
                tex1 = new Tex2D("dat/ui/themes/coldblue/butform.png");
            }
            public override void OnUpdate()
            {
                base.OnUpdate();
               
            }
            public override void OnRender()
            {
           
                Draw.Rect(20, 20, 200, 200);
                Draw.Rect(20, 300, 200, 200, tex1);
                Draw.Rect3D(300, 20, 200, 200, GRot, tex1);
                
            }
        }
        public class NextOS : UIApp 
        {
            public NextOS()
                : base("Next OperatingSystem Alpha One",false)
            {
                Log.Log(LogType.OS, "Started OS..", "", this as object, DateTime.Now);
            }
            public override void Render()
            {
           
            }
            public override void CreateStates()
            {
                base.CreateStates();
                AddState(new Background());
                Log.Log(LogType.OS, "Created initial states", "", this as object, DateTime.Now);
            }
            public override void Start()
            {
                StartState("BackgroundThread");
                Log.Log(LogType.OS, "Started initial states", "", this as object, DateTime.Now);
                SetMat();
            }
            public override void OnMouseDown(System.Drawing.Point pos, MouseKey key)
            {
                if (key == MouseKey.Left)
                {
                    Log.ToConsole();
                }
                if (key == MouseKey.Right)
                {
                    System.Environment.Exit(1);
                }
            }
            public override void OnMouse(System.Drawing.Point pos, int xd, int yd)
            {
                Background.GRot = new Vector3(pos.X, 0, pos.Y);
            }
            
        }
        static void Main(string[] args)
        {

            NextOS app = new NextOS();
            app.Run();
            

        }
    }
}
